import Vue from 'vue'
import Router from 'vue-router'
//import HelloWorld from '@/child/HelloWorld'
import Login from '@/views/login/login'
import Houtai from '@/views/houtai/houtai'

import Home from '@/views/home' // 主页容器
import Index from '@/views/home/Index' // 首页
import GSJJ from '@/views/home/Gsjj' // 公司简介
import Course from '@/views/home/Course'
import Baoming from '@/views/home/Baoming'
import Zhaopin from '@/views/home/Zhaopin'
import Liuyan from '@/views/home/Liuyan'
import Geren from '@/views/home/Geren'
import Video from '@/views/home/Video'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      redirect: '/home/index',// 访问home自动重定向到home/index默认首页
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/home/index',
      children: [ // 公共菜单下切换的子页面,注意子路由的path没有"/"
        {
          path: 'index',
          name: 'Index',
          component: Index
        } ,
        { // 公司简介
          path: 'gsjj',
          name: 'Gsjj',
          component: GSJJ
        },
        {
          path: 'course',
          name: 'Course',
          component: Course
        },
        {
          path: 'baoming',
          name: 'Baoming',
          component: Baoming
        },
        {
          path: 'zhaopin',
          name: 'Zhaopin',
          component: Zhaopin
        },
        {
          path: 'liuyan',
          name: 'Liuyan',
          component: Liuyan
        },

      ]
    } ,
    { // 个人中心单独一个页面
      path: '/geren',
      name: 'Geren',
      component: Geren
    },
    { //视频播放页面
      path: '/video',
      name: 'Video',
      component: Video
    },
    {
      path: '/Houtai',
      name: 'Houtai',
      component: Houtai
    },

  ]
})
